<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<#if film??>
<title>Download YouTube Video ${film.title}</title>
<meta name="description"
	content="Download YouTube Video ${film.title} by Free Online YouTube Downloader" />
<#else>
<title>Free Online YouTube Downloader for Win and Mac-ShareYouTubeVideo</title>
<meta name="description"
	content="Free Online YouTube Downloader for Win and Mac, just copy and paste YouTube URL to download high quality MP4/FLV videos." />
</#if>
<meta name="keywords" content="YouTube video downloader, download YouTube videos, free YouTube downloader, YouTube downloader online, YouTube Downloader Mac" />
<link href="${cssRoot}/global.css" rel="stylesheet" type="text/css" />
<link href="${cssRoot}/ui/jquery-ui-1.8.17.custom.css" rel="stylesheet"
	type="text/css" />
</head>
<body>	
    <#include "/i18n/" + locale + "/head.ftl">
	<input type="hidden" id="contextPath" value="${request.contextPath}" />
	<div id="serverUrl" style="display:none">${serverUrl ! ""}</div>
	<div id="main">
		<div class="textbox">
			<h1>Free YouTube Downloader</h1>
			<p class="dd" <#if locale='pa_PK'>style="direction: rtl;"</#if>>
				<a href="${request.contextPath}/">ShareYouTubeVideo.com</a> ${i18n("introduce")}
			</p>
		</div>
		<!--help us spread the word-->
		<div class="sp_word">
			<div class="tipw">${i18n("spread")}</div>
			<div class="tip_cont">
				<div id="fb-root"></div>
				<script type="text/javascript">
					var addthis_config = {
						data_ga_property : 'UA-27764810-2'
					};
				</script>

				<script>
					(function(d, s, id) {
						var js, fjs = d.getElementsByTagName(s)[0];
						if (d.getElementById(id))
							return;
						js = d.createElement(s);
						js.id = id;
						js.src = "//connect.facebook.net/zh_CN/all.js#xfbml=1";
						fjs.parentNode.insertBefore(js, fjs);
					}(document, 'script', 'facebook-jssdk'));
				</script>

				<script type="text/javascript">
					var addthis_config = {
						pubid : "ra-4edc321f02b434d3"
					}
				</script>
				<div class="fb-like" style="float: left;"
					data-href="http://www.facebook.com/ShareYouTubeVideo"
					data-send="false" data-layout="button_count" data-width="94"
					data-show-faces="false"></div>
				<!-- AddThis Button BEGIN -->
				<script type="text/javascript">
					var addthis_config = {
						pubid : "ra-4edc321f02b434d3"
					}
				</script>
				<div class="addthis_toolbox addthis_default_style "
					style="float: left;">
					<div class="addthis_toolbox" addthis:url="#"
						addthis:title="Free YouTube Downloader">
						<a class="addthis_button_tweet"></a> <a
							class="addthis_button_google_plusone" g:plusone:size="medium"></a>
					</div>
					<script type="text/javascript"
						src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4edc321f02b434d3"></script>
				</div>
				<!-- AddThis Button END -->
			</div>
		</div>
		<!-- textbox end -->
	</div>
	<!-- main end -->
	<div id="main">
		<!-- Eenter youtube url-->
		<div class="enter_url">
			<div class="engle_l"></div>
			<div class="enter_box">
				<span class="font1">${i18n("txtUrl_prompt")}</span>
				<div class="url_inputbox">
					<div class="url_input">
						<#if videoId??>
							<#assign displayUrl = "http://www.youtube.com/watch?v=" + videoId>
							<input type="text" id="txtUrl"  value="${displayUrl}" />
						<#else>
							<#assign displayUrl = "lady gaga">
							<input type="text" id="txtUrl" style="color:#BBBBBB" value="${displayUrl}" />
						</#if>
					</div>
					<div class="video_cbox">
						<input id="btnAnalyze" type="button" name="Get YouTube Video"
							onclick="parseVideos();" />
					</div>
				</div>
			</div>
			<div class="engle_r"></div>
		</div>
		<!-- Eenter youtube url end-->
		
		<#if errorMsg??>
		<div id="resultArea" class="video_qty">
			<div class="qty_menu">
				<form id="form2" name="form2" method="post">
					<div id="result" style="font-size: 20px">
						${errorMsg}
					</div>
				</form>
			</div>
		</div>
  		<#elseif film??>
  		<!--video quality-->
  		<div id="applet" style="display:none">
			<applet name="YouTube Downloader" 
				codebase="${request.contextPath}/applet/" 
				code=com.wontube.ObtainVideoApplet.class 
				archive="${request.contextPath}/applet/yt-downloader-1.0.0.jar"
				height="1" width="1" align="center" MAYSCRIPT>
				<param name="url" value="${film.itemUrl}"/>
				<apram name="ua" value="${userAgent}" />
			</applet>
		</div>
		<div id="resultArea" class="video_qty">
			<div class="qty_top"></div>
			<div class="qty_cont">
				<div id="resultTip">
					<p class="filename">
						<span class="font2">${i18n("filename")}</span> <span id="filename" class="font3">${film.title}.mp4</span>
					</p>
					<div class="sltbox" <#if locale='pa_PK'>style="direction: rtl;"</#if>>
						<div class="slt_l"></div>
						<div class="slt_cont">${i18n("quality")}</div>
						<div class="slt_r"></div>
					</div>
				</div>
				<div class="qty_menu">
					<form id="form2" name="form2" method="post">
						<div id="result" style="font-size: 20px">
						</div>
						<div id="divDownload" class="btn_box" style="display:none">
							<a id="btnDownload" href='#'
								onclick="_gaq.push(['_trackEvent', 'Video', 'Download', '${film.title}']);"><img
								src="${request.contextPath}/style/images/download.gif" width="233" height="59"
								alt="download videos"/></a>
						</div>
					</form>
					<div class="addon_ins">
						<b>Tips:</b> 1. You may install <a href="http://www.wontube.com/free-youtube-downloader.html">Free YouTube Downloader for Android</a> to download videos from YouTube on your Android phone directly. 
  <br/>
  <span style="padding-left:37px;"></span>2. <a href="http://www.wontube.com">Get Free MP3 and Videos at WonTube.com</a>  <br/>
 <span style="padding-left:37px;"></span>3. <a href="http://free.wondershare.com/free-video-converter.html?utm_source=referral&utm_medium=textlink&utm_campaign=convertvc">Download Free Video Converter for Windows >> &gt;&gt;</a></div>
					</div>
				</div>
			</div>
			<div class="qty_botm"></div>
		</div>
	</div>
	<!--video quality end-->
	<#else>
		<!--video converter faq-->
		<div id="tipArea" class="video_qty">
			<div class="qty_top"></div>
			<div class="qty_cont add_spad">
				<div class="sltbox"  <#if locale='pa_PK'>style="direction: rtl;float:right"</#if>>
					<div class="slt_l"></div>
					<div class="slt_cont " >
						<span class="font5">${i18n("operate_prompt")}</span>
					</div>
					<div class="slt_r"></div>
				</div>
				<#if locale='pa_PK'>
					<div style="clear:both" ></div>
				</#if>
				<#include "/i18n/${locale}/${locale}.ftl">
				
			</div>
			<div class="qty_botm"></div>
		</div>
		<!----faq end-->
	</#if>
	<#include "/include/footer.ftl">
	<script type="text/javascript" src="${jsRoot}/utils.js"></script>
	<script type="text/javascript" src="${jsRoot}/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="${jsRoot}/js.js"></script>
	<script type="text/javascript" src="${jsRoot}/getVideos.js"></script>
	<script type="text/javascript" src="${jsRoot}/ui/jquery-ui-1.8.17.custom.min.js"></script>
	<script type="text/javascript" src="${jsRoot}/prompt.js"></script>
	<script type="text/javascript" src="${jsRoot}/search.js"></script>
	<script type="text/javascript">
		$(function(){
			$("#.menu > ul > li").currentMenu({
				text : '${i18n("home")}',
				style : "curr"
			});
			initPrompt();
			initSite();
		});
	</script>
	<#if film??>
	<script type="text/javascript">
		if(!isJreInstalled()){
			var html = '<div style="font-size:12pt;">It appears you do not have Java installed or it is disabled on your system. '
				+ 'You can get Java <a style="font-size:12pt;color:blue" href="http://www.java.com/getjava/" class="link" target="_blank">here</a>.</div>';
			$('#result').html(html);
		} else {
			$('#applet').show();
			$('#result').html('<img src="${request.contextPath}/images/load.gif" />&nbsp;Loading applet ...</img>');
		}
	</script>
	</#if>
</body>
</html>
